package com.hoas.quickstart.threads.chapter03.chapter03_2_5;

public class ThreadB extends Thread {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + " b run begin time=" + System.currentTimeMillis());
        try {
            Thread.sleep(5000);
            System.out.println(Thread.currentThread().getName() + " b run end time=" + System.currentTimeMillis());

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    synchronized public void bService() {
        System.out.println(Thread.currentThread().getName() +" 打印了 bService timer=" + System.currentTimeMillis());
    }

}
